home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Illustrated Works of Shakespeare
/
Illustrated Works of Shakespeare, The (1990)(Animated Pixels)[!][CDTV-PC].iso
/
shakes
/
code
/
shakespeare.amos
/
shakespeare.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1991-04-10
|
60KB
|
2,009 lines
Set Buffer 40
Rem *************************************
Rem * The Complete Works Of Shakespeare *
Rem * (C)1991 Animated pixels Ltd. *
Rem * Written By Darren Lines. *
Rem *************************************
On Error Proc AN_ERROR
Hide
Screen Open 6,320,288,32,Lowres : Screen Hide 6 : Screen 6 : Cls 0
Curs Off : Flash Off : Auto View Off
Load Iff "Ap:Shakes/Graphics/Loader-title1",0
Screen Hide 0 : Screen Copy 0,0,0,320,256 To 6,0,0
Screen Display 6,128,35,320,288 : Screen 6 : Get Palette 0
Screen Close 0 : Screen Show 6 : Auto View On
Rem *************
Rem * Variables *
Rem *************
Dim BOOKMARKS(10) : Dim T$(5) : Dim NUMERAL$(99)
Dim MARK$(7) : Dim MARK(7) : Dim ICON_INF$(9) : Dim INDEX$(30)
Dim MACH$(100) : Dim FO$(50) : Dim CHAPTER(160) : Dim SEL$(50)
Dim _POF(2500)
Global _POF(),LAST_M_KEY,LAST_ACT$,K_KEY$,LAST_KEY$
Global INDX,INDX_MAX,BUTTON,X,Y,FILE$,TXT_ARRAY_LEN,A,SEL$()
Global M_X,M_Y,SHELF_OFFSET,TX,T$(),S_BOOK,FLAG,NUM_TYPE,INDEX$()
Global ACT,ABOOK,FLG_EXIT,CHAP_POINTER,CHAP_POINTER_MAX
Global SEL,SEL1,MARK$(),MARK(),ACT$,ICON_INF$(),A$
Global ICONS_Y,SHELF_Y,SEARCH_FLG,SEARCH$,TEMP_FILE_POINTER
Global BOOKMARKS(),NUMERAL$(),M_KEY,XT,YT,SND_FLAG,WORD
Global PNUM,VERSE$,BOOK,CHAPTER,VERSE,TEMP_ACT$,CHAPTER()
Global PIC_NUM,PIC_NUM_STR$,ICON_OFFSET,TEMP,FLAG_EXIT,FSIZE,NEW_FLG
Global F_POINTER,FILE_POINTER,X,Y,MOST_Y,MOST_DIFF,NO_CLEAR
Global TP_Y_AMOUNT,NEW_TP_Y_AMOUNT,BT_Y_AMOUNT,NEW_BT_Y_AMOUNT,PAGE_SIZE
Global FLAG_NEW_FILE,TITLE$,SCR_H,FACE,INFO$,SCR_FLAG,OLD_ACT$,CHAP_POINTER
Global FACE_OFFSET,SCR_HEIGHT,FACE_NAME$,OLD_S_BOOK,FLG_DIR,TEMP_SEL,TEMP_P
Global DRECTORY$,DRECTORY1$,HILIGHT$,JSTICK,X_M,Y_M,BACK_SCREEN,SCR_FLG,FLG_TEXT
Global MACH$(),REENTER_TEMP$,REENTER_F$,REENTER_COUNT1,REENTER_COUNT
Global REENTER_FLG,S_COUNT,TITLE1$,FIL$,REENTER_F_WORD$,REENTER_F_WORD1$
Global FO$(),FO_MAX,FO,FO1,PAL,CHAP_MAX,Z$,P$,SX,TX,DEMO_FLG,BOOK$
Global BUFFER_LEN,BUFFER_ADDR,STRING_ADDR,BUFFER_SIZE,PIC_FLG,CHAP_X
Pload "Ap:Assembler/Code/Amos_Match",6 : Set Envel 1,0 To 2,63
Proc VAR_SETUP
Proc SETUP : Proc FIRST_LOAD
Rem *************
Rem * MAIN LOOP *
Rem *************
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
Proc MOUSE_CONVERT
Repeat
Proc MOUSE_CONVERT
SCR_FLG=0
If(M_KEY and 1)=1 Then Proc SCR_TEXT_DOWN
If(M_KEY and 2)=2 Then Proc SCR_TEXT_UP
If(M_KEY and 4)=4 Then Proc ICON_LEFT
If(M_KEY and 8)=8 Then Proc ICON_RIGHT
If(M_KEY and 16)=16
Sprite 9,128+160-10,250-20-(43*PAL)+20,2
CHECK_ICON_A
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
End If
If(M_KEY and 32)=32
Sprite 9,128+160-10,250-20-(43*PAL)+20,2
CHECK_ICON_B
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
End If
K$=Inkey$
If(M_KEY and $40)
Proc CHECK_ICON1
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
End If
If(M_KEY and $80)
Sprite 9,,,2
Proc SEARCH_REENTER
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
End If
Until 0
Show
End
Procedure MOUSE_CONVERT
X Mouse=288
Y Mouse=250-(43*PAL)
M_KEY=0
OLD_TIMER=Timer
Repeat
XT=X Mouse
YT=Y Mouse
If YT<250-(43*PAL) Then M_KEY=(M_KEY or 1)
If YT>250-(43*PAL) Then M_KEY=(M_KEY or 2)
If XT<288 Then M_KEY=(M_KEY or 4)
If XT>288 Then M_KEY=(M_KEY or 8)
K_KEY$=Inkey$
If Key State($4C) Then M_KEY=(M_KEY or 1)
If Key State($4D) Then M_KEY=(M_KEY or 2)
If Key State($4F) Then M_KEY=(M_KEY or 4)
If Key State($4E) Then M_KEY=(M_KEY or 8)
If Key State($50) Then M_KEY=(M_KEY or 16)
If Key State($51) Then M_KEY=(M_KEY or 32)
If Key State($45) or Key State(95) Then M_KEY=(M_KEY or 64)
If Key State($43) Then M_KEY=(M_KEY or 128)
M_KEY=M_KEY or(Mouse Key*16)
JJJ=Joy(1)
M_KEY=M_KEY or JJJ
Until M_KEY<>0 or NO_REPEAT_FLG=1 or(Timer>OLD_TIMER+4) or(K_KEY$<>"")
If(M_KEY and $FF)<>0 and SND_FLAG=0 and(LAST_M_KEY<>M_KEY)
If JJJ=0
Play $F,50,0
Else
Play $F,30,0
End If
End If
LAST_M_KEY=M_KEY : LAST_KEY$=K_KEY$
End Proc
Procedure VAR_SETUP
Open In 7,"ap:Shakes/Code/Fonts.Dat"
A=1 : Repeat : XXX=Free : Line Input #7,FO$(A) : Inc A : Until Eof(7) or(A>50) : Close 7
FO_MAX=A-1
FACE_OFFSET=0 : FLAG_NEW_FILE=0 : FILE_POINTER=0
F_POINTER=0 : BOOK=2 : PNUM=1 : FO=18 : FLAG_EXIT=0 : FACE_FLG=1
SOUND=0 : SEARCH_FLG=1 : BUTTON=0 : TXT_ARRAY_LEN=20
SHELF_OFFSET=0 : TX=1 : T$="" : SEL=1 : SEL1=1 : CHAP_POINTER=1
JSTICK=1 : BACK_SCREEN=1023 : SCR_FLG=0 : FLG_TEXT=0
REENTER_TEMP$="" : REENTER_FLG=0 : NUM_TYPE=0
TEMP=8 : BUFFER_LEN=103964 : BUFFER_SIZE=0 : DEMO_FLG=0
Hide : Curs Off : Bob Update Off
FO1=21 : If Ntsc Then PAL=1 Else PAL=0
Set Input 10,-1
Channel 0 To Sprite 9
Anim 0,"(6,10)(7,10)(8,10)(9,10)(10,10)L"
End Proc
Procedure SETUP
PIC_NUM=1
SCR_H=186
ICONS_Y=218-(43*PAL)+5
ICON_OFFSET=0
Auto View Off
Screen Open 0,640,SCR_H+23,16,Hires : Rem scroll
Screen Open 1,320,256,16,Lowres : Rem pici
Screen Open 2,13*72,70,32,Lowres : Rem icons
Screen Open 3,640,256,32,Lowres : Rem temp
Screen Display 0,128,35,640,SCR_H-(43*PAL) : Rem SCROLL
Screen Display 2,128,ICONS_Y,320,70 : Rem ICONS
For A=0 To 3 : Screen A : Flash Off : Curs Off : Next A
Screen Hide 3 : Screen To Front 6
Rem **************
Rem * Load Icons *
Rem **************
Load Iff "ap:Shakes/Graphics/icons",3
Screen To Front 6
Screen Copy 3,0,0,74*4,71 To 2,0,0
Screen Copy 3,0,71,72*4,71*2 To 2,(72*4),0
Screen Copy 3,0,71*2,72*4,71*3 To 2,(72*8),0
Screen Copy 3,0,71*3,72*4,71*4 To 2,(72*12),0
Screen Copy 3,72*3,71*2,72*4,71*3 To 2,(75*11)+9,0
Screen 2
Get Palette 3 : Colour 17,$D97 : Colour 18,$D75 : Colour 19,$C54
Screen To Front 2
Screen Offset 2,TEMP,0
Screen To Front 6
Rem ***************
Rem * Load Scroll *
Rem ***************
If PAL=0
Load Iff "ap:Shakes/Graphics/scroll_hires",3
Else
Load Iff "ap:Shakes/Graphics/scroll_hires_ntsc",3
End If
Screen 3 : Curs Off
Screen To Front 6
Screen Copy 3,0,0,640,SCR_H To 0,0,0
Screen Copy 0,0,1,640,21 To 0,0,SCR_H+1-(43*PAL)
Screen 0 : Get Palette 3 : Get Palette 2,$FFFF0000
Colour 14,$FFF : Colour 15,0
Screen 1 : Cls 0
Screen To Front 0 : Screen To Front 2 : Screen To Front 6
Auto View On
Rem *********************
Rem * Create Icon Zones *
Rem *********************
Screen 2
Reserve Zone 9
For Z=0 To 8
Set Zone Z+1,128+14+(72*Z),10 To 128+64+(72*Z),61
Next Z
Limit Mouse 128,54 To 446,290
End Proc
Procedure DISPLAY_A_PIC
F$=Str$(S_BOOK)-" " : If Len(F$)=1 Then F$="0"+F$
F$="Ap:Shakes/Pictures/"+F$+"/"+SEL$(SEL)+".Iff"
If Exist(F$)
Screen 0
PIC_FLG=1
Screen 1
Fade 2 : Wait 10
Load Iff F$,1
Screen Display 1,128,35,320,256-(43*PAL)
Screen To Back 1
If DEMO_FLG=0
Screen Show 1
Else
Screen Hide 1
End If
Else
PIC_FLG=0
Screen 1
Cls 0
End If
Screen Hide 1
End Proc
Procedure BUTTON_WAIT
NO_REPEAT_FLG=1
Repeat : MOUSE_CONVERT : Until(M_KEY and $70)=0
NO_REPEAT_FLG=0
End Proc
Procedure BUTTON_WAIT1
NO_REPEAT_FLG=1
Repeat : MOUSE_CONVERT : Until(M_KEY and $70)<>0
NO_REPEAT_FLG=0
End Proc
Procedure ICON_LEFT
If ICON_OFFSET=0 Then Pop Proc
For A=0 To 35/2
Add TEMP,-4
Screen Offset 2,TEMP,0 : Wait Vbl
Next A
Dec ICON_OFFSET
End Proc
Procedure ICON_RIGHT
If ICON_OFFSET>7 Then Pop Proc
For A=0 To 35/2
Add TEMP,4
Screen Offset 2,TEMP,0 : Wait Vbl
Next A
Inc ICON_OFFSET
End Proc
Procedure CHECK_ICON_A
Screen 2
Z=Mouse Zone
If Z=1 Then Proc UP_SCROLL
If Z=2 Then Proc CHAPTER_INC
If Z=3
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Proc BOOK_LOAD
End If
If Z=4 Then Proc PIC_SHOW
If Z=5 Then Proc SLIDE_SHOW
If Z=6
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Proc BOOK_MARK
End If
If Z=7
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Proc SEARCH_TEXT
End If
If Z=8 Then Proc FONTS_UP
If Z=9 Then Proc CHAPTER_VERSE
End Proc
Procedure CHECK_ICON_B
Screen 2
Z=Mouse Zone
If Z=1 Then Proc DWN_SCROLL
If Z=2 Then Proc CHAPTER_DEC
If Z=8 Then Proc FONTS_DOWN
End Proc
Procedure CHECK_ICON1
Screen 2 : Z=Mouse Zone
If Z<1 or Z>9 Then Pop Proc
Sprite Off 9
Screen Hide 0 : Screen Hide 4 : Screen Hide 2
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Z1$=Str$(Z)-" " : Screen Hide 1
Load Iff "Ap:Shakes/Tutorial/Help_Screen"+Z1$,1
Screen Display 1,128,35,640,256
Screen Show 1
XM=1 : OLD_XM=0
Colour 17,$B73
Colour 18,$D93
Colour 19,$FB8
FLAG_EXIT=0
SUB=0
Repeat
MOUSE_CONVERT
If(M_KEY and 4)=4 Then XM=0
If(M_KEY and 8)=8 Then XM=1
If OLD_XM<>XM
Sprite 1,128+16+(XM*248),230,3
End If
If((M_KEY and $10)<>0 and(XM=1)) or((M_KEY and $20)<>0)
FLAG_EXIT=1
End If
If((M_KEY and $10)=$10) and(XM=0)
Add SUB,1
Z$=Chr$(Asc("a")+SUB-1)
If Exist("Ap:Shakes/Tutorial/Help_Screen"+Z1$+Z$)
Load Iff "Ap:Shakes/Tutorial/Help_Screen"+Z1$+Z$,7 : Screen Hide 7
Screen 1 : Fade 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 : Wait 16
Screen Copy 7 To 1
Fade 1 To 7,$FFFF : Wait 16
Screen Close 7
Screen Show 1
Else
Add SUB,-1
End If
End If
OLD_XM=XM
Until FLAG_EXIT=1
Sprite Off 1
Proc BUTTON_WAIT
If PIC_FLG=1
A$=Str$(S_BOOK)-" "
If Len(A$)=1
A$="0"+A$
End If
Load Iff "Ap:Shakes/Pictures/"+A$+"/"+ACT$+".Iff",1
Screen To Back 1 : Screen Hide 1
Else
Screen 1 : Cls 0 : Screen To Back 1 : Screen Hide 1
End If
Screen Show 4 : Screen Show 2 : Screen Show 0
End Proc
Procedure VERSE
Proc ACT_PRINT
Pof(1)=Leek(Start(9)+(INDX*4))
Screen 4
Cls 1,16,0 To 624,BACK_SCREEN
Screen Offset 4,0,FACE_OFFSET
Gr Writing 0
X=30 : Y=5+Text Base
PAGE_SIZE=Y-Text Base
XXX=Free
Line Input #1,TEST$ : A=Instr(TEST$,Chr$(9))
A1=Instr(TEST$,Chr$(32))
If A<>0
FACE$=Mid$(TEST$,1,A-1)
TEST$=Mid$(TEST$,A+1,Len(TEST$))
PROPORTIONAL[FACE$] : X=X+10
Else
If A1=0 and INDX>0
XXX=Free : Line Input #1,A$ : TEST$=TEST$+" "+A$+" "
End If
End If
TEST$=TEST$-Chr$(9)
PROPORTIONAL[TEST$]
Y=Y+FSIZE : X=30
Repeat
XXX=Free : Line Input #1,TEST$
C=Asc(Mid$(TEST$,1,1))
TEST$=TEST$-Chr$(9)
If(C=32) or(C=9)
PROPORTIONAL[TEST$]
Y=Y+FSIZE : X=30
End If
Until((C<>32) and(C<>9) and(C<>13)) or Eof(1) and Y<1024-FSIZE
If Eof(1) Then FLAG_NEW_FILE=1
PAGE_SIZE=Y-PAGE_SIZE
Gr Writing 1
'Screen Copy 0,0,SCR_H+1-(43*PAL),640,SCR_H+21-(43*PAL) To 0,0,166-(43*PAL)
If DEMO_FLG=0
Screen Show 4
End If
End Proc
Procedure PROPORTIONAL[Z$]
TX=1 : SX=1
Z$=Z$-Chr$(13)+" "
Repeat
Repeat
SX=Instr(Z$," ",SX)
If SX<Len(Z$)
P$=Mid$(Z$,TX,SX-TX)
X1=Text Length(P$)
Add SX,1
Else
P$=Mid$(Z$,TX,Len(Z$))
X1=Text Length(P$)
SX=Len(Z$)
End If
If X1+X>615
SX=OLD_SX-1
P$=Mid$(Z$,TX,SX-TX)
End If
OLD_SX=SX
Until SX>=Len(Z$) or X1+X>615
Set Text 2 : Ink 3 : Text X+1,Y+1,P$
Set Text 0 : Ink 2 : Text X,Y,P$
Add Y,FSIZE
If SX<Len(Z$) Then X=40 Else X=X+X1
TX=SX
Until SX>=Len(Z$)
Add Y,-FSIZE
End Proc
Procedure PIC_SHOW
If PIC_FLG=0 Then Pop Proc
Proc BUTTON_WAIT
Screen Show 1 : Sprite Off 9
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Screen Hide 4
SY1=35
SY2=ICONS_Y
Auto View On
Screen To Front 0
Repeat
Wait Vbl
Screen Display 0,,SY1,,
Screen Display 2,,SY2,,
Add SY1,2
Add SY2,-2
Until SY2<-40
Proc BUTTON_WAIT1
Screen To Front 2
Screen To Front 4
Repeat
Wait Vbl
Screen Display 0,,SY1,,
Screen Display 2,,SY2,,
Add SY1,-2
Add SY2,2
Until SY2=ICONS_Y+2
Screen Show 4 : Screen Hide 1
Proc BUTTON_WAIT
End Proc
Procedure FONTS_UP
Inc FO1
If FO1>FO_MAX Then FO1=1
Screen 4 : SET_FONT[FO1] : FO=Param : Set Font Param
F_STR$=Font$(FO) : FSIZE=Val(Mid$(F_STR$,30,4))
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
FACE_OFFSET=0 : Proc VERSE : Proc ACT_PRINT
End Proc
Procedure FONTS_DOWN
Dec FO1
If FO1=0 Then FO1=FO_MAX
Screen 4 : SET_FONT[FO1] : FO=Param : Set Font FO
F_STR$=Font$(FO) : FSIZE=Val(Mid$(F_STR$,30,4))
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
FACE_OFFSET=0 : Proc VERSE : Proc ACT_PRINT
End Proc
Procedure CHAPTER_INC
If SEL$(SEL+1)="#" Then Pop Proc
Add SEL,1
Close 1
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9
Open In 1,DRECTORY$+SEL$(SEL)
ACT$=SEL$(SEL)
INDX=0
FACE_OFFSET=0
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Proc VERSE
Proc DISPLAY_A_PIC
NO_CLEAR=1 : Proc ACT_PRINT : NO_CLEAR=0
End Proc
Procedure CHAPTER_DEC
If SEL=1 Then Pop Proc
Add SEL,-1
Close 1
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9
Open In 1,DRECTORY$+SEL$(SEL)
ACT$=SEL$(SEL)
INDX=0
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
FACE_OFFSET=0
Proc VERSE
Proc DISPLAY_A_PIC
NO_CLEAR=1 : Proc ACT_PRINT : NO_CLEAR=0
End Proc
Procedure UP_SCROLL
FLG_DIR=1
F$=""
If FLAG_NEW_FILE=1 or INDX=INDX_MAX
Add SEL,1
If SEL$(SEL)="#"
SEL=1
If S_BOOK<41
Add S_BOOK,1
Proc FIND_BOOK[S_BOOK]
INDX=-1
Else
Add INDX,-1
End If
Else
Close 1
Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9 : INDX=-1
ACT$=SEL$(SEL) : OLD_ACT$="#"
End If
FLAG_NEW_FILE=0
End If
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
FACE_OFFSET=0
Add INDX,1
VERSE
If Mid$(ACT$,1,Instr(ACT$,"_"))<>Mid$(OLD_ACT$,1,Instr(OLD_ACT$,"_")) Then Proc DISPLAY_A_PIC
NO_CLEAR=1 : Proc ACT_PRINT : NO_CLEAR=0
OLD_ACT$=ACT$
End Proc
Procedure DWN_SCROLL
FLG_DIR=0
FLAG_NEW_FILE=0
Add INDX,-1
If INDX>-1
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
FACE_OFFSET=0
Proc VERSE
End If
If INDX<0
Add SEL,-1
If SEL=0
SEL=1
If S_BOOK>0
Add S_BOOK,-1
Proc FIND_BOOK[S_BOOK]
FACE_OFFSET=0
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Proc VERSE
Else
Add INDX,1
End If
Else
Close 1
Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9
INDX=INDX_MAX
FACE_OFFSET=0
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Proc VERSE
ACT$=SEL$(SEL) : OLD_ACT$="#"
End If
End If
If Mid$(ACT$,1,Instr(ACT$,"_"))<>Mid$(OLD_ACT$,1,Instr(OLD_ACT$,"_")) Then Proc DISPLAY_A_PIC
NO_CLEAR=1 : Proc ACT_PRINT : NO_CLEAR=0
OLD_ACT$=ACT$
End Proc
Procedure BOOK_LOAD
OLD_S_BOOK=S_BOOK
SHELF_Y=0
Auto View Off
Screen Open 4,(22*34),256,16,Lowres
Screen Hide 4
Screen 4 : Cls 0 : Flash Off : Curs Off
Load Iff "Ap:Shakes/Graphics/BOOKSHELF1",3
Screen Hide 3
Screen Copy 3,0,0,305,256 To 4,0,0
Load Iff "Ap:Shakes/Graphics/BOOKSHELF2",3
Screen Hide 3
Screen Copy 3,0,0,305,256 To 4,305,0
Load Iff "Ap:Shakes/Graphics/BOOKSHELF3",3
Screen Hide 3
Screen Copy 3,0,0,305,256 To 4,305*2,0
Screen Display 4,140,35,320,256-(43*PAL)
Screen 4
Get Palette 3
Screen Close 3
Colour 17,$B73
Colour 18,$D93
Colour 19,$FB8
Screen Hide 2
Screen Show 4
Screen To Front 4
Auto View On
Sprite Off 9
If NEW_FLG=1 and SHELF_OFFSET>(34*5) Then SHELF_OFFSET=(34*5)
Screen Offset 4,SHELF_OFFSET,SHELF_Y
Screen Show 4
Screen To Front 4
FLG_EXIT=0
DEL=10
X_M=5 : Y_M=0
Screen 4
Screen Hide 0
Repeat
Proc MOUSE_CONVERT
XM=X Hard(4,X_M*34)
If PAL=0 Then YM=Y Hard(4,56+(Y_M*140)) Else YM=Y Hard(4,56+(Y_M*100))
If(M_KEY and 16)=16
Sprite 9,XM,YM-20,3
Wait 5
Sprite 9,XM,YM-20,4
Wait 5
Sprite 9,XM,YM-20,5
Else
Sprite 9,XM,YM-20,3
End If
A=PAL
While A=1
If Y_M=1 and SHELF_Y=0
For SHELF_Y=1 To 42 Step 2
Wait Vbl : Screen Offset 4,SHELF_OFFSET,SHELF_Y
Next SHELF_Y
Wait Vbl : Screen Offset 4,SHELF_OFFSET,SHELF_Y
End If
If Y_M=0 and SHELF_Y>0
For SHELF_Y=42 To 1 Step -2
Wait Vbl : Screen Offset 4,SHELF_OFFSET,SHELF_Y
Next SHELF_Y
Wait Vbl : Screen Offset 4,SHELF_OFFSET,SHELF_Y
End If
A=0
Wend
If M_KEY<>0 Then Wait DEL
If(M_KEY and 4)=4 and X_M>-1 Then Add X_M,-1
If(M_KEY and 8)=8 and X_M<9 Then Add X_M,1
If(M_KEY and 1)=1 and Y_M>0 Then Add Y_M,-1
If(M_KEY and 2)=2 and Y_M<1 Then Add Y_M,1
If(X_M=-1 and(M_KEY and 4)=4) and SHELF_OFFSET<>0
For X=1 To 17
Proc SHELF_LEFT
Wait Vbl : Screen Offset 4,SHELF_OFFSET,SHELF_Y
Next X
End If
If(X_M=9 and(M_KEY and 8)=8) and SHELF_OFFSET<(12*34)
For X=1 To 17
Proc SHELF_RIGHT
Wait Vbl : Screen Offset 4,SHELF_OFFSET,SHELF_Y
Next X
End If
If X_M=-1 Then X_M=0
If X_M=9 Then X_M=8
S_BOOK=(X_M+(SHELF_OFFSET/34))
S_BOOK=S_BOOK+(Y_M*21)
If(M_KEY and 16)=16 and(S_BOOK<42)
Proc FIND_BOOK[S_BOOK]
Else
If(M_KEY and $20)=$20
FLG_EXIT=1
Else
FLG_EXIT=0
End If
M_KEY=0
End If
Until M_KEY<>0 or FLG_EXIT<>0
If FLG_EXIT=1
S_BOOK=OLD_S_BOOK
End If
Sprite Off 9
Proc BUTTON_WAIT
Screen Show 2
Screen Show 0
Screen Hide 4
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen Hide 4
Screen 4 : Curs Off : Flash Off
Screen Display 4,128,56,320,144-(43*PAL)
Screen 4 : Flash Off : Cls 0 : Cls 1,16,0 To 624,BACK_SCREEN : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Set Font FO
FACE_OFFSET=0
Proc BOOK_LIST
Proc VERSE
Proc DISPLAY_A_PIC
Proc ACT_PRINT
OLD_ACT$=ACT$
End Proc
Procedure SHELF_LEFT
If SHELF_OFFSET=0 Then Pop Proc
Add SHELF_OFFSET,-2
End Proc
Procedure SHELF_RIGHT
A=NEW_FLG
While A=0
If SHELF_OFFSET>(12*34) Then Pop Proc
A=-1
Wend
While A=1
If SHELF_OFFSET>(5*34) Then Pop Proc
A=-1
Wend
Add SHELF_OFFSET,2
End Proc
Procedure FIND_BOOK[TEMP1]
Close 1
Proc BOOK_LIST
SEL=1
DRECTORY$="Ap:Shakes/Text/"
A$=Str$(TEMP1)-" " : If Len(A$)=1 Then A$="0"+A$
DRECTORY$=DRECTORY$+A$+"/"
Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9 : INDX=0
End Proc
Procedure BOOK_LIST
A$=Str$(S_BOOK)-" " : If Len(A$)=1 Then A$="0"+A$
DRECTORY$="Ap:Shakes/Text/"+A$+"/"
Open In 3,DRECTORY$+"00_00.inf"
Z=0
Repeat
XXX=Free : Line Input #3,A$ : A$=A$-Chr$(13)
SEL$(Z)=A$
Inc Z
Until A$="#"
ACT$=SEL$(SEL)
TITLE$=SEL$(0)
SEL=1 : SEL_MAX=Z-1
Close 3
End Proc
Procedure SEARCH_TEXT
For A=0 To 4 : T$(A)="" : Next A
Screen Open 4,320,230,32,Lowres
Screen Hide 4 : Screen Hide 1
Screen 4
Curs Off
Flash Off
Auto View Off
Load Iff "Ap:Shakes/Graphics/keypad_v2",3
Screen Hide 3
Screen Copy 3,0,0,320,205 To 4,0,0
Curs Off : Flash Off : Auto View On : Screen 4
Get Palette 3 : Get Palette 0,$F0000
If SEARCH_FLG=1
Screen Copy 3,2,206,70,206+26 To 4,161,121
Else
Screen Copy 3,73,206,72+70,206+26 To 4,160,121
End If
Screen Display 4,128,35,320,200
Screen Show 4
Screen To Front 4
REENTER_FLG=0
WORD=0
Screen Hide 2
Gr Writing 0
SET_FONT[12] : Set Font Param
Ink 0
Text 23,175,T$(WORD)
Ink 15
Text 21,173,T$(WORD)
FLG_EXIT=0
T_X=0 : T_Y=1
X_M=X Hard(4,16+(T_X*32))
Y_M=Y Hard(4,T_Y*32)
OLD_M_KEY=0
B_X=0
Screen Copy 3,217+(WORD*19),204+5,217+(WORD*19)+18,204+18-2 To 4,280-3,84+12
Repeat
If FLG_MOVE=1 Then Wait 10
Proc MOUSE_CONVERT
OLD_M_KEY=M_KEY
If T_Y<4 Then X_M=X Hard(4,16+(T_X*32))
If T_Y=4 Then X_M=X Hard(4,50+(B_X*70))
Y_M=Y Hard(4,T_Y*32)
If(M_KEY and 16)=16
Sprite 9,X_M-20,Y_M-20+20,2
Proc BUTTON_WAIT
M_KEY=16
Else
Sprite 9,X_M-20,Y_M-20+20,1
End If
CON=0
TEMP1=T_Y
While TEMP1=3
If T_X<3 Then B_X=0
If T_X>2 and T_X<5 Then B_X=1
If T_X>4 and T_X<7 Then B_X=2
If T_X>6 Then B_X=3
TEMP1=0
Wend
TEMP1=T_Y
While TEMP1=4
If B_X=0 Then T_X=1
If B_X=1 Then T_X=4
If B_X=2 Then T_X=6
If B_X=3 Then T_X=8
TEMP1=0
Wend
If(M_KEY and $F)<>0 Then FLG_MOVE=1 Else FLG_MOVE=0
If(M_KEY and 4)=4 and T_X>0 and T_Y<4 Then Add T_X,-1
If(M_KEY and 8)=8 and T_X<9 and T_Y<4 Then Add T_X,1
If(M_KEY and 1)=1 and T_Y>1 and T_Y<5 Then Add T_Y,-1
If(M_KEY and 2)=2 and T_Y<4 and T_Y<4 Then Add T_Y,1
If(M_KEY and 4)=4 and B_X>0 and T_Y=4 Then Add B_X,-1
If(M_KEY and 8)=8 and B_X<3 and T_Y=4 Then Add B_X,1
A=(T_X)+(10*(T_Y-1))+65
If(M_KEY and 16)=16 and T_Y<4 Then CON=1
If(M_KEY and 16)=16 and T_Y=4 and B_X=0 Then CON=3
If(M_KEY and 16)=16 and T_Y=4 and B_X=1 Then CON=2
If(M_KEY and 16)=16 and T_Y=4 and B_X=2 Then CON=5
If(M_KEY and 16)=16 and T_Y=4 and B_X=3 Then CON=4
If Chr$(A)="[" Then A=Asc("'")
If Chr$(A)="\" Then A=Asc("-")
X$=Upper$(K_KEY$) : If((X$>="A") and(X$<="Z")) or(X$="-") or(X$="'") Then A=Asc(X$) : Play $F,50,0 : CON=1
If X$=Chr$(8) Then CON=2 : Play $F,50,0
If X$=(Chr$(13)) or(X$=" ") Then CON=1 : A=Asc("]") : Play $F,50,0
If CON=1
While(Chr$(A)="^") or(Chr$(A)="]")
A=Asc("")
Inc WORD
While WORD=5
WORD=0
Wend
Screen Copy 3,217+(WORD*19),204+5,217+(WORD*19)+18,204+18-2 To 4,280-3,84+12
Screen Copy 3,21,152,300,175 To 4,21,152
Ink 0
Text 23,175,T$(WORD)
Ink 15
Text 21,173,T$(WORD)
CON=0
Wend
End If
If CON=1
T$(WORD)=T$(WORD)+Chr$(A)
End If
T=Text Length(T$(WORD))
A=Len(T$(WORD))
If CON=1 and(T>260 or A>62)
T$(WORD)=Mid$(T$(WORD),1,A-1)
End If
If CON=2 and A>0
T$(WORD)=Mid$(T$(WORD),1,A-1)
End If
If CON=4 Then FLG_EXIT=1
If CON<>0
Wait Vbl
Rem * put screen copy here to blank out line
Screen Copy 3,21,152,300,175 To 4,21,152
Ink 0
Text 23,175,T$(WORD)
Ink 15
Text 21,173,T$(WORD)
T1$=T$(WORD)
End If
If CON=5
While SEARCH_FLG=0
SEARCH_FLG=1
Screen Copy 3,2,206,70,206+26 To 4,161,121
CON=1
Wend
While SEARCH_FLG=1 and CON<>1
SEARCH_FLG=0
Screen Copy 3,73,206,72+70,206+26 To 4,160,121
Wend
End If
While CON<>0 and(M_KEY and 16)=16
Sprite 9,X_M-20,Y_M-20+20,2
Proc MOUSE_CONVERT
Wend
While CON=3
TEMP$=""
For A=0 To 4
If T$(A)<>"" Then TEMP$=TEMP$+T$(A)+" "
Next A
Proc SEARCH[TEMP$] : Screen 4 : Get Palette 0,$FFFF0000
While(CON<>2) and(Param>0)
Rem Screen Open 4,320,230,32,Lowres
Rem Screen Hide 4 : Screen 4 : Curs Off : Flash Off
Rem Screen Copy 3,0,0,320,200 To 4,0,0
If SEARCH_FLG=1
Screen Copy 3,2,206,70,206+26 To 4,161,121
Else
Screen Copy 3,73,206,72+70,206+26 To 4,160,121
End If
Screen Copy 3,217+(WORD*19),204+5,217+(WORD*19)+18,204+18-2 To 4,280-3,84+12
Screen 4
Gr Writing 0
SET_FONT[12] : Set Font Param
Ink 0
Text 23,175,T$(WORD)
Ink 15
Text 21,173,T$(WORD)
Get Palette 3 : Get Palette 0,$FFFF0000
Screen Display 4,128,35,320,200
Screen Show 4
Screen To Front 4
CON=2
Wend
CON=-1
Wend
If(M_KEY and 32)=32 Then FLG_EXIT=1
Until(FLG_EXIT<>0) or(FLAG=2)
FLAG=0
Erase 16
SET_FONT[12] : Set Font Param
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
Screen Display 3,128,35,320,200
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen Hide 4
Screen 4 : Flash Off : Cls 0 : Cls 1,16,0 To 624,BACK_SCREEN : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Screen Display 4,128,56,320,144-(43*PAL)
Screen 4 : Set Font FO
Screen Show 0 : Screen Show 4
Screen Show 2
Screen Close 3
FACE_OFFSET=0 : DEMO_FLG=1 : Proc VERSE
Proc DISPLAY_A_PIC : DEMO_FLG=0
Proc ACT_PRINT
End Proc
Procedure FIRST_LOAD
Rem ***********************************************
Rem * load first book, first chapter, first verse *
Rem ***********************************************
SEL=1 : S_BOOK=0
Proc BOOK_LIST
Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Reserve As Work 9,(1*1024)
Bload DRECTORY$+SEL$(SEL)+".Idx1",9
INDX=0
ACT$="01_01"
F_POINTER=0
Get Fonts
PIC_FLG=1
OLD_ACT$=ACT$
Screen Close 3
Curs Off
Screen Close 6
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen Display 4,128,56,640,144-(43*PAL)
Screen 4 : Flash Off : Cls 0 : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Cls 1,16,0 To 624,BACK_SCREEN
Proc FONTS_UP
Screen 0 : Ink 0 : Pen 0 : Draw 0,0 To 16,0
Gr Writing 0
Proc DISPLAY_A_PIC
End Proc
Procedure BOOK_MARK
Proc BUTTON_WAIT
Screen Open 4,640,200,16,Hires
Screen Display 4,140,35,640,210
Screen Hide 4 : Screen Hide 1
Screen 4
Curs Off
Flash Off
Auto View Off
Load Iff "Ap:Shakes/Graphics/book_mark_hires",3
Screen Hide 3
Screen 4
Get Palette 3 : Get Palette 2,$FFFF0000
Screen Copy 3,0,0,640,200 To 4,0,0
Screen Offset 4,0,0
Screen Show 4
Screen To Front 4
Screen Hide 2
Auto View On
Rem ********************
Rem * Functions :- *
Rem * Insert,Goto,Exit *
Rem ********************
Screen 4
Gr Writing 0
M=1
Screen 4
SET_FONT[19] : Set Font Param : Set Text 2
Ink 2
For A=1 To 7
If MARK$(A)<>""
A$=Mid$(MARK$(A),1,2)
B$=Mid$(MARK$(A),3,5)
DRECTORY$="Ap:Shakes/Text/"+A$+"/"
Open In 3,DRECTORY$+"00_00.Inf"
Input #3,A$
A$=A$-Chr$(13)
Close 3
C$=Mid$(B$,4,2)
B$=Mid$(B$,1,2)
Z=NUM_TYPE
While Z<>0
B$=NUMERAL$(Val(B$))
C$=NUMERAL$(Val(C$))
Z=0
Wend
Z=NUM_TYPE
While Z=0
B$=Str$(Val(B$))
C$=Str$(Val(C$))
Z=1
Wend
D$=B$
While(D$<>" 0") and(D$<>"")
Z$=Mid$(A$,1,30)+", Act "+B$+" Scene "+C$
D$=""
Wend
D$=B$
While(D$=" 0") or(D$="")
Z$=Mid$(A$,1,30)+", "+Mid$(MARK$(A),3,Len(MARK$(A)))
D$=" "
Wend
Text 158,(A*24)+17,Z$
End If
Next A
Gr Writing 2
Bar 154,(M*24)+1 To 617,(M*24)+19
Gr Writing 0
Rem **********************
Rem * wait for selection *
Rem **********************
M=1 : M1=M
FLG_EXIT=0
B_X=0
Y_M=180
X_M=180 : OLD_X_M=0
Repeat
Proc MOUSE_CONVERT
If(M_KEY and 16)=16
Sprite 9,X_M-10,Y_M+20,2
Proc BUTTON_WAIT
M_KEY=16
Else
If OLD_X_M<>X_M
Sprite 9,X_M-10,Y_M+20,1
End If
End If
FLG=0 : M_FLG=0 : OLD_X_M=X_M
If(M_KEY and 1)=1 and M>1 Then M1=M : Add M,-1 : M_FLG=1 : Wait 10
If(M_KEY and 2)=2 and M<5 Then M1=M : Add M,1 : M_FLG=1 : Wait 10
If(M_KEY and 4)=4 and B_X>0 Then Add B_X,-1 : Wait 10 : Proc MOUSE_CONVERT
If(M_KEY and 8)=8 and B_X<2 Then Add B_X,1 : Wait 10 : Proc MOUSE_CONVERT
If B_X=0 Then X_M=180
If B_X=1 Then X_M=290
If B_X=2 Then X_M=390
Rem **********
Rem * insert *
Rem **********
If(M_KEY and 16)=16 and B_X=0 Then FLG=1
While FLG=1
A$=Str$(S_BOOK)-" " : If Len(A$)=1 Then A$="0"+A$
B$=ACT$ : OLD_X_M=0
MARK$(M)=A$+B$
BOOKMARKS(M)=INDX
A$=Mid$(MARK$(M),1,2)
B$=Mid$(MARK$(M),3,5)
D$=""
DRECTORY$="Ap:Shakes/Text/"+A$+"/"
Open In 3,DRECTORY$+"00_00.inf"
Input #3,D$
D$=D$-Chr$(13)
Close 3
C$=Mid$(B$,4,2)
B$=Mid$(B$,1,2)
Z=NUM_TYPE
While Z<>0
B$=NUMERAL$(Val(B$))
C$=NUMERAL$(Val(C$))
Z=0
Wend
Z=NUM_TYPE
While Z=0
B$=Str$(Val(B$))
C$=Str$(Val(C$))
Z=1
Wend
If B$<>" 0"
Z$=Mid$(D$,1,30)+", Act "+B$+" Scene "+C$
Else
Z$=Mid$(D$,1,30)+", "+ACT$
End If
A$=""
Screen Copy 3,155,(M*24)-3,625,(M*24)+23 To 4,155,(M*24)-3
Ink 2
Text 158,(M*24)+17,Z$
Gr Writing 2
Bar 154,(M*24)+1 To 617,(M*24)+19
Gr Writing 0
FLG=0
Wend
FLG=0
Rem ********
Rem * Goto *
Rem ********
If(M_KEY and 16)=16 and B_X=1 Then FLG=1
While FLG=1
A$=Mid$(MARK$(M),1,2)
B$=Mid$(MARK$(M),3,5)
D$="" : OLD_X_M=0
DRECTORY$="Ap:Shakes/Text/"+A$+"/"
FLG=0 : If A$<>"" Then FLG_EXIT=2
Wend
Rem ********
Rem * Exit *
Rem ********
If(M_KEY and 16)=16 and B_X=2 Then FLG_EXIT=1
FLG=0
Rem ***************
Rem * Select Mark *
Rem ***************
If M_FLG<>0 Then FLG=1
If FLG=1
Gr Writing 2
Bar 154,(M1*24)+1 To 617,(M1*24)+19
Bar 154,(M*24)+1 To 617,(M*24)+19
Gr Writing 0
M1=M
End If
Until(M_KEY and 32)=32 or FLG_EXIT<>0
A$=Mid$(MARK$(M),1,2)
Screen Close 3
While FLG_EXIT=2 and(A$<>"")
Rem *********************************
Rem * Now goto book, Chapter, Verse *
Rem *********************************
B$=Mid$(MARK$(M),3,Len(MARK$(M))) : Rem * Chapter *
S_BOOK=Val(A$) : Close 1
Proc BOOK_LIST
Z=0
Repeat
Inc Z
Until SEL$(Z)=B$
SEL=Z
A$=Mid$(MARK$(M),1,2)
DRECTORY$="Ap:Shakes/Text/"
DRECTORY$=DRECTORY$+A$+"/"
Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9 : INDX=0
Rem ********************************
Rem * open book at particular part *
Rem ********************************
ACT$=SEL$(SEL)
INDX=BOOKMARKS(M)
FACE_OFFSET=0
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen Hide 4
Screen 4 : Curs Off : Flash Off
Screen Display 4,128,56,320,144-(43*PAL)
Screen 4 : Flash Off : Cls 0 : Cls 1,16,0 To 624,BACK_SCREEN : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Screen Show 2 : Screen Show 4
Screen 4 : Set Font FO : Set Text 0
FACE_OFFSET=0
Proc VERSE
Proc DISPLAY_A_PIC
Proc ACT_PRINT
FLG_EXIT=3
Wend
Proc BUTTON_WAIT
While FLG_EXIT<>3
Sprite 9,128+160-10,250-20-(43*PAL)+20,1
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen Hide 4
Screen 4 : Curs Off : Flash Off
Screen Display 4,128,56,320,144-(43*PAL)
Screen 4 : Flash Off : Cls 0 : Cls 1,16,0 To 624,BACK_SCREEN : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Screen Show 2 : Screen Show 4
Screen 4 : Set Font FO : Set Text 0
FACE_OFFSET=0
Proc VERSE
Proc ACT_PRINT
FLG_EXIT=3
Wend
End Proc
Procedure ACT_PRINT
Screen 0
SET_FONT[22] : Set Font Param : Gr Writing 0 : Set Text 2
If NO_CLEAR=0
Screen Copy 0,0,SCR_H+1-(43*PAL),640,SCR_H+21-(43*PAL) To 0,0,1
Screen Copy 0,0,SCR_H+1-(43*PAL),640,SCR_H+21-(43*PAL) To 0,0,166-(43*PAL)
ACT=Val(Mid$(ACT$,1,Instr(ACT$,"_")))
VERSE=Val(Mid$(ACT$,Instr(ACT$,"_")+1,Len(ACT$)))
If NUM_TYPE=1
A1$=NUMERAL$(ACT)
A2$=NUMERAL$(VERSE)
Else
A1$=Str$(ACT)-" "
A2$=Str$(VERSE)-" "
End If
If A1$<>"0"
B$="Act "+A1$+" Scene "+A2$
Else
B$=ACT$
End If
L=Text Length(B$)
L=320-(L/2)
Ink 0 : Text L,166+15-(43*PAL),B$
Set Text 0 : Ink 14 : Text L-1,166+15-(43*PAL)-1,B$
L=Text Length(TITLE$)
L=320-(L/2)
Set Text 2 : Ink 0 : Text L,15,TITLE$
Set Text 0 : Ink 14 : Text L-1,15-1,TITLE$
End If
If PIC_FLG=1
Set Text 2 : Ink 0 : Text 500,166+15-(43*PAL),"Picture"
Set Text 0 : Ink 14 : Text 500-1,166+15-(43*PAL)-1,"Picture"
End If
If PAGE_SIZE>140-(43*PAL)
Set Text 2 : Ink 0 : Text 30,180-(44*PAL),">"
Text 29,180-(44*PAL),"-"
Text 29-9,180-(44*PAL),"-"
Set Text 0 : Ink 14 : Text 30-1,180-(44*PAL)-1,">"
Text 29-1,180-(44*PAL)-1,"-"
Text 29-9-1,180-(44*PAL)-1,"-"
End If
End Proc
Procedure SCR_TEXT_DOWN
If FACE_OFFSET+2-(43*PAL)>(PAGE_SIZE-140) Then Pop Proc
A=1
Repeat
Add FACE_OFFSET,1
Wait Vbl
Screen Offset 4,0,FACE_OFFSET
Add A,1
Until A>FSIZE
SCR_FLG=1
End Proc
Procedure SCR_TEXT_UP
If FACE_OFFSET-2<0 Then Pop Proc
A=1
Repeat
Add FACE_OFFSET,-1
Wait Vbl
Screen Offset 4,0,FACE_OFFSET
Add A,1
Until A>FSIZE
SCR_FLG=1
End Proc
Procedure SEARCH[SEARCH$]
SCR_FLAG=0 : FLAG=0
HILIGHT$=""
If SEARCH_FLG=1
TEMPER=41
Else
TEMPER=1
End If
Pack 4 To 16,16+64,16,320-16-64,128
OLD_SEARCH$=SEARCH$
NOSEARCH=0
Reserve As Work 11,64*5 : Rem Words
Reserve As Work 12,2*5 : Rem Word Lengths
Reserve As Work 13,2*200 : Rem Store
TF=0
For A=0 To 4
T$=" "+Upper$(T$(A))+" "
If(Len(T$) and 1)=1 Then T$=T$+" "
ADR=Start(11)+(A*64)
For L=1 To Len(T$)
Poke(ADR+L-1),Asc(Mid$(T$,L,1))
Next L
Doke Start(12)+(A*2),Len(T$)
If Len(T$)<>2
Inc TF
End If
Next A
Repeat
If SEARCH_FLG<>1
TEMP$=Str$(TEMPER)-" "
Else
TEMP$=Str$(S_BOOK)-" "
End If
If Len(TEMP$)=1
TEMP$="0"+TEMP$
End If
Open In 7,"Ap:Shakes/Text/"+TEMP$+"/00_00.Inf"
XXX=Free : Line Input #7,YY$ : YY$=YY$-Chr$(13) : Close 7
If Len(YY$)>32 Then YY$=Mid$(YY$,1,32)
SET_FONT[19] : Set Font Param
Cls 2,16+64,16 To 320-16-64,128
Box 16+64,16 To 319-16-64,127
ZZ$="Searching Book"
L=Text Length(ZZ$)
Text 160-(L/2),60,ZZ$
SET_FONT[16] : Set Font Param
L=Text Length(YY$)
Text 160-(L/2),90,YY$
Reserve As Work 10,BUFFER_LEN : Rem Search File
Bload "Ap:Shakes/Text/"+TEMP$+"/Words.Idx",10
Timer=0
Call 6,Start(10),Length(10),Start(11),Start(12),Start(13)
FOUND$="" : S_COUNT=0 : Erase 10
If Dreg(0)=0
For A=0 To Dreg(1)
ADR=Start(13)+(A*4)
Z=Deek(ADR)
If Z=(TF-1)
Z=Deek(ADR+2)
Z$=Str$(Z)-" "
FOUND$=FOUND$+TEMP$+":"+Z$+" " : Add S_COUNT,1
End If
Next A
If S_COUNT>0
Proc VEIW_AND_DECIDE[FOUND$,S_COUNT]
Screen Open 4,320,230,32,Lowres
Screen Hide 4 : Screen 4 : Curs Off : Flash Off
If FLAG<>2
Screen Copy 3,0,0,320,200 To 4,0,0
If SEARCH_FLG=1
Screen Copy 3,2,206,70,206+26 To 4,161,121
Else
Screen Copy 3,73,206,72+70,206+26 To 4,160,121
End If
Screen Copy 3,217+(WORD*19),204+5,217+(WORD*19)+18,204+18-2 To 4,280-3,84+12
Screen 4
Gr Writing 0
SET_FONT[12] : Set Font Param
Ink 0
Text 23,175,T$(WORD)
Ink 15
Text 21,173,T$(WORD)
Get Palette 3 : Get Palette 0,$FFFF0000
Screen Display 4,128,35,320,200
Screen Show 4
Screen To Front 4
End If
Add NOSEARCH,1
End If
End If
Proc MOUSE_CONVERT
Inc TEMPER
Until TEMPER>41 or(FLAG>=1) or((M_KEY and 32)=32)
If NOSEARCH=0
Cls 2,16+64,16 To 320-16-64,128
Box 16+64,16 To 319-16-64,127
SET_FONT[19] : Set Font Param
ZZ$="NOT FOUND"
L=Text Length(ZZ$)
Text 160-(L/2),50,ZZ$
ZZ$="Press A Key"
L=Text Length(ZZ$)
Text 160-(L/2),85,ZZ$
Proc BUTTON_WAIT1
SET_FONT[12] : Set Font Param
End If
If FLAG<>2 Then Unpack 16
Proc BUTTON_WAIT
B=FLAG
While B=2
ACT$=TEMP_ACT$
S_WORD=Instr(REENTER_F_WORD$,":")
S_BOOK=Val(REENTER_F_WORD1$)
Proc FIND_BOOK[S_BOOK]
SEL=TEMP_SEL
Close 1
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9
Open In 1,DRECTORY$+SEL$(SEL)
ACT$=SEL$(SEL)
INDX=TEMP_P
B=0
Wend
Erase 10 : Erase 11 : Erase 12 : Erase 13
End Proc[S_SIZE]
Procedure VEIW_AND_DECIDE[TEMP$,S_COUNT1]
TEMP_PIC_FLG=0 : Sprite Off 9 : Screen Close 4
Screen 0 : Cls 13,16,21 To 624,21+144-(43*PAL)
Screen Open 7,320,48,16,Lowres : Screen Hide 7
Screen 7 : Curs Off : Flash Off : Get Palette 3 : Cls 0
Screen 7 : Get Palette 0,$FFFF0000
Screen Copy 3,145,204,215,232 To 7,0,0
Screen Copy 3,145,204,215,232 To 7,125,0
Screen Copy 3,145,204,215,232 To 7,250,0
Screen Copy 3,0,235,40,248 To 7,15,6
Screen Copy 3,42,235,92,248 To 7,125+10,6
Screen Copy 3,94,235,94+41,248 To 7,250+16,6
Screen Display 7,128,218-(43*PAL),320,48 : Screen Show 7
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen 4 : Flash Off : Cls 0 : Cls 1,16,0 To 624,BACK_SCREEN : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Screen Display 4,128,56,320,144-(43*PAL)
Screen 0 : Colour 17,$D97 : Screen 4 : Colour 17,$D97 : Screen 7 : Colour 17,$D97
Screen To Front 0 : Screen To Front 4 : Screen To Front 7
Rem *********************
Rem * Reenter Specifics *
Rem *********************
If REENTER_FLG=1
TEMP$=REENTER_TEMP$
S_COUNT=REENTER_COUNT
S_COUNT1=REENTER_COUNT1
Else
S_COUNT=0
End If
A=Len(F$)
ACT1$=ACT$
TITLE1$=TITLE$
OLD_FILE_POINTER=-1
OLD_SEL=-1
Repeat
F_WORD=Instr(TEMP$," ")
F_WORD$=Mid$(TEMP$,1,F_WORD-1)
REENTER_F_WORD$=F_WORD$
TEMP$=Mid$(TEMP$,F_WORD+1,Len(TEMP$))
F_WORD1=Instr(F_WORD$,":")
F_WORD1$=Mid$(F_WORD$,1,F_WORD1-1)
F_WORD$=Mid$(F_WORD$,F_WORD1+1,Len(F_WORD$))
FIL$="Ap:Shakes/Text/"+F_WORD1$+"/"
While F_WORD<>0
A=Val(F_WORD$)
TEMP_SEL=(A/256)
TEMP_P=A-(TEMP_SEL*256)
If TEMP_SEL<>OLD_SEL
OLD_SEL=TEMP_SEL
OLD_FILE_POINTER=-1
End If
Open In 5,FIL$+"00_00.inf"
XXX=Free : Line Input #5,TITLE$
TITLE$=TITLE$-Chr$(13)
Z=0
Repeat
XXX=Free : Line Input #5,SEL$
Inc Z
Until Z=TEMP_SEL
SEL$=SEL$-Chr$(13)
Close 5
ACT$=SEL$
Open In 5,FIL$+SEL$
Open In 6,FIL$+SEL$+".Idx"
Pof(6)=(TEMP_P*9)
XXX=Free : Line Input #6,T$ : T=Val(T$)
Pof(5)=T
Inc S_COUNT
While T<>OLD_FILE_POINTER
OLD_FILE_POINTER=T
TEMP_FILE_POINTER=T
Screen 4 : Set Font FO
Proc VERSE1
Proc ACT_PRINT
Screen 0
SET_FONT[22] : Set Font Param : Gr Writing 0
A$="Word :"+Str$(S_COUNT)+" Of"+Str$(S_COUNT1)
Set Text 2 : Ink 0 : Text 45+1,(166+14)-(44*PAL)+1,A$
Set Text 0 : Ink 14 : Text 45,(166+14)-(44*PAL),A$
FLAG=0
B_X=0
OLD_M_KEY=0
Y_M=Y Hard(7,14)
X_M=X Hard(7,40)
Sprite 9,X_M-10,Y_M-20+20,1
Repeat
Proc MOUSE_CONVERT
If(M_KEY and $10)<>0
Sprite 9,X_M-10,Y_M-20+20,2
End If
Y_M=Y Hard(7,14)
If(M_KEY and 1)=1 Then Proc SCR_TEXT_UP
If(M_KEY and 2)=2 Then Proc SCR_TEXT_DOWN
MOVE_FLG=0
If(M_KEY and 4)=4 and B_X>0
Add B_X,-1 : MOVE_FLG=1
End If
If(M_KEY and 8)=8 and B_X<2
Add B_X,1 : MOVE_FLG=1
End If
If B_X=0 Then X_M=X Hard(7,40)
If B_X=1 Then X_M=X Hard(7,160)
If B_X=2 Then X_M=X Hard(7,280)
If MOVE_FLG<>0
Sprite 9,X_M-10,Y_M-20+20,1
Wait 10 : Proc MOUSE_CONVERT
End If
FLG=0
If(M_KEY and $10)<>0 Then FLG=1
If(M_KEY and 32)=32 Then FLAG=1 : M_KEY=1 : B_X=3
If Key State($43) and(B_X=0)
M_KEY=1
FLAG=3
Else
If B_X<>3
M_KEY=0
End If
End If
If FLG=1 and B_X=0 Then FLG=2 : M_KEY=1
If FLG=1 and B_X=1 Then FLAG=1 : M_KEY=1
If FLG=1 and B_X=2 Then FLAG=2 : M_KEY=1
Until M_KEY<>0
Wend
Close 5
Close 6
F_WORD=0
Wend
Until(TEMP$="") or(FLAG<>0)
If TEMP$="" and(FLAG<>2) Then SCR_FLG=1
If FLAG=2 Then DRECTORY$=FIL$
If(FLAG=2) : Rem and(TEMP$<>"")
REENTER_F_WORD$=F_WORD$
REENTER_F_WORD1$=F_WORD1$
REENTER_TEMP$=TEMP$
REENTER_F$=FIL$
REENTER_COUNT1=S_COUNT1 : Rem Total Number Of Finds
REENTER_COUNT=S_COUNT : Rem Number Been Through So Far
SCR_FLG=1
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Else
REENTER_TEMP$=""
End If
PIC_FLG=TEMP_PIC_FLG
If FLAG=1 Then SCR_FLG=1
TEMP_ACT$=ACT$
ACT$=ACT1$
TITLE$=TITLE1$
Screen Close 7 : Screen Open 4,320,230,32,Lowres
Screen Hide 4 : Curs Off : Flash Off
End Proc
Procedure VERSE1
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
FACE_OFFSET=0
Proc ACT_PRINT
Screen 4 : Cls 1,16,0 To 624,BACK_SCREEN
Screen Offset 4,0,FACE_OFFSET
Gr Writing 0
X=30 : Y=5+Text Base
FACE_OFFSET=0
PAGE_SIZE=Y-Text Base
F=1
XXX=Free
Line Input #5,TEST$ : A=Instr(TEST$,Chr$(9))
A1=Instr(TEST$,Chr$(32))
If A<>0
FACE$=Mid$(TEST$,1,A-1)
TEST$=Mid$(TEST$,A+1,Len(TEST$))
PROPORTIONAL1[FACE$] : X=X+10
Else
If A1=0
If FLG_DIR=0
Add INDX,-1
Pof(1)=Leek(Start(9)+(INDX*4))
XXX=Free : Line Input #5,TEST$
Else
Add INDX,1
End If
XXX=Free : Line Input #5,A$ : TEST$=TEST$+" "+A$+" "
End If
End If
TEST$=TEST$-Chr$(9)
PROPORTIONAL1[TEST$]
Y=Y+FSIZE : X=30
Repeat
Line Input #5,TEST$
C=Asc(Mid$(TEST$,1,1))
TEST$=TEST$-Chr$(9)
If(C=32) or(C=9)
PROPORTIONAL1[TEST$]
Y=Y+FSIZE : X=30
End If
Until((C<>32) and(C<>9) and(C<>13)) or Eof(5) or Y>1023-FSIZE
Y=Y+FSIZE
PAGE_SIZE=Y-PAGE_SIZE
Gr Writing 1
'Screen Copy 0,0,SCR_H+1-(43*PAL),640,SCR_H+21-(43*PAL) To 0,0,166-(43*PAL)
Wait Vbl
Screen Show 4
End Proc
Procedure AN_ERROR
Default
Screen 0 : Cls 0
Print "Error In Program."
Print "Error number :-";Errn
Repeat : Until 0
End Proc
Procedure PROPORTIONAL1[Z$]
Screen 4
Z$=Z$+" "
Z$=Z$-Chr$(13)
Set Font FO
PX=0 : B=1 : F=0 : S_LEN=Text Length(" ")
If Mid$(Z$,1,1)<>Chr$(32) Then
Repeat
PX=Instr(Z$," ",B)
P$=Mid$(Z$,B,(PX-B)+1) : X1=Text Length(P$)
If X+X1>625
Y=Y+FSIZE : X=40
End If
Z=0 : Z_FLG=0
Repeat
If Upper$(P$-"?"-"'"-" "-";"-","-"."-":"-"["-"]"-'"')=T$(Z) and(T$(Z)<>"") Then Z_FLG=1
Inc Z
Until Z>4 or Z_FLG<>0
If Z_FLG<>0
Set Text 3 : Ink 3 : Text X+1,Y+1,P$
Set Text 1 : Ink 2 : Text X,Y,P$
Else
Set Text 2 : Ink 3 : Text X+1,Y+1,P$
Set Text 0 : Ink 2 : Text X,Y,P$
End If
X=Xgr : Y=Ygr : B=PX+1
Until B>=Len(Z$)
Set Text 0
End Proc
Procedure SEARCH_REENTER
If REENTER_TEMP$="" Then Pop Proc
Load Iff "Ap:Shakes/Graphics/keypad_v2",3
Screen Hide 3 : Screen Hide 2 : SCR_FLAG=0
REENTER_FLG=1
Proc VEIW_AND_DECIDE[REENTER_TEMP$,REENTER_S_COUNT1]
Screen Close 3 : Screen Show 2 : Screen Hide 1
B=FLAG
While B=2
ACT$=TEMP_ACT$
S_WORD=Instr(REENTER_F_WORD$,":")
S_BOOK=Val(REENTER_F_WORD1$)
Proc FIND_BOOK[S_BOOK]
SEL=TEMP_SEL
Close 1
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9
Open In 1,DRECTORY$+SEL$(SEL)
ACT$=SEL$(SEL)
INDX=TEMP_P
B=0
Wend
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen Hide 4
Screen 4 : Flash Off : Cls 0 : Cls 1,16,0 To 624,BACK_SCREEN : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Screen Display 4,128,56,320,144-(43*PAL)
Screen Show 1 : Screen Show 0
Screen 4
Set Font FO
Proc VERSE
Proc ACT_PRINT
End Proc
Procedure SET_FONT[Z]
A$=Mid$(FO$(Z),1,35)
A=1
Repeat
B$=Mid$(Font$(A),1,30)+":"+Mid$(Font$(A),30,4)
Inc A
Until Upper$(A$)=Upper$(B$) or A>50
A=A-1
If A>=FO_MAX Then A=1
End Proc[A]
Procedure SLIDE_SHOW
Sprite Off 9
Screen Show 1 : SY1=35 : SY2=ICONS_Y
Auto View On
Screen To Front 0
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Screen Hide 4
Repeat
Wait Vbl
Screen Display 0,,SY1,,
Screen Display 2,,SY2,,
Add SY1,2 : If SY1>35+200 Then Add SY1,-2
Add SY2,-2
Until SY2<-40
TEMP_FO=FO
Screen Display 4,128,SY1,640,144-(43*PAL) : Screen Show 4 : Screen 4
TEMP_S_BOOK=S_BOOK
FLG_EXIT=0
VIRGIN=1
BOOK$=Str$(TEMP_S_BOOK)-" " : If Len(BOOK$)=1 Then BOOK$="0"+BOOK$
SEL_TEMP=SEL
If PIC_FLG=0
Z=SEL : FLG=0
Repeat
BOOK$=Str$(TEMP_S_BOOK)-" "
If Len(BOOK$)=1
BOOK$="0"+BOOK$
End If
Repeat
If Exist("Ap:Shakes/Pictures/"+BOOK$+"/"+SEL$(Z)+".Iff")
FLG=1
End If
Add Z,1
Until SEL$(Z)="#" or FLG<>0
If FLG=0
Inc TEMP_S_BOOK
If TEMP_S_BOOK>41
TEMP_S_BOOK=0
End If
BOOK$=Str$(TEMP_S_BOOK)-" "
If Len(BOOK$)=1
BOOK$="0"+BOOK$
End If
Open In 3,"Ap:Shakes/Text/"+BOOK$+"/00_00.INF"
Z=0
Repeat
XXX=Free : Line Input #3,A$ : A$=A$-Chr$(13)
SEL$(Z)=A$
Inc Z
Until A$="#"
Close 3
End If
Z=1
Until FLG<>0
End If
Repeat
TITLE$=SEL$(0)
Repeat
FIL$=SEL$(SEL_TEMP)
While FIL$<>"#"
Screen 1
A$="Ap:Shakes/Pictures/"+BOOK$+"/"+FIL$+".Iff"
If Exist(A$)
Fade 3 : Wait 3*16
Load Iff A$,1
Screen Display 1,128,35,320,256-(43*PAL)
Screen To Back 1 : Screen Show 1
Screen Copy 0,0,SCR_H+1-(43*PAL),640,SCR_H+21-(43*PAL) To 0,0,1
Screen Copy 0,0,SCR_H+1-(43*PAL),640,SCR_H+21-(43*PAL) To 0,0,166-(43*PAL)
Screen 0
SET_FONT[22] : Set Font Param : Gr Writing 0
L=Text Length(SEL$(0))
L=320-(L/2)
Set Text 2 : Ink 0 : Text L+1,15+1,SEL$(0)
Set Text 0 : Ink 14 : Text L,15,SEL$(0)
A1$=Str$(Val(Mid$(SEL$(SEL_TEMP),1,2)))
A2$=Str$(Val(Mid$(SEL$(SEL_TEMP),4,2)))
If A1$<>"0"
B$="Act "+A1$+" Scene "+A2$
Else
B$=ACT$
End If
L=Text Length(B$)
L=320-(L/2)
Set Text 2 : Ink 0 : Text L+1,166+15-(43*PAL)+1,B$
Set Text 0 : Ink 14 : Text L,166+15-(43*PAL),B$
Screen 4 : Set Font FO
F_STR$=Font$(FO) : FSIZE=Val(Mid$(F_STR$,30,4))
Screen Copy 4,0,2,640,144-(43*PAL) To 0,0,23
Screen Hide 4
Screen Offset 4,0,0
Screen 4 : Gr Writing 0 : Cls 1,16,0 To 624,200
X=30 : Y=5+Text Base
Open In 7,"Ap:Shakes/Text/"+BOOK$+"/"+FIL$
XXX=Free : Line Input #7,TEST$
PROPORTIONAL[TEST$]
Repeat
XXX=Free : Line Input #7,TEST$
C=Asc(Mid$(TEST$,1,1))
TEST$=TEST$-Chr$(9)
If(C=32) or(C=9)
PROPORTIONAL[TEST$]
Y=Y+FSIZE : X=30
End If
Until((C<>32) and(C<>9)) or Eof(1)
Close 7
Screen Display 4,128,SY1+21,,
Screen Show 4
Screen To Front 4
Timer=0
Repeat
Proc MOUSE_CONVERT
If M_KEY<>0
Timer=0
End If
If(M_KEY and 1)=1 and SY1>35+4
Add SY1,-4
If SY1=255
Add SY1,-4
End If
End If
If(M_KEY and 2)=2 and SY1<320
Add SY1,4
If SY1=255
Add SY1,4
End If
End If
Screen Display 4,128,SY1+21,,
Screen Display 0,128,SY1,,
Wait Vbl
If(M_KEY and 16+32)<>0
FLG_EXIT=1
End If
If(M_KEY and 32)
FLG_EXIT=3
End If
Until Timer>250 or FLG_EXIT<>0 or Key State(67)
If FLG_EXIT<>3
FLG_EXIT=0
End If
If Key State(67)
FLG_EXIT=2
End If
End If
FIL$="#"
Wend
Inc SEL_TEMP
FIL$=SEL$(SEL_TEMP)
Until FIL$="#" or FLG_EXIT>=2
If FLG_EXIT<2
SEL_TEMP=1
TEMP_ACT=1
Inc TEMP_S_BOOK
If TEMP_S_BOOK>41
TEMP_S_BOOK=1
End If
BOOK$=Str$(TEMP_S_BOOK)-" "
If Len(BOOK$)=1
BOOK$="0"+BOOK$
End If
Open In 3,"Ap:Shakes/Text/"+BOOK$+"/00_00.INF"
Z=0
Repeat
XXX=Free : Line Input #3,A$ : A$=A$-Chr$(13)
SEL$(Z)=A$
Inc Z
Until A$="#"
Close 3 : TITLE$=SEL$(0)
End If
Repeat : MOUSE_CONVERT : Until(M_KEY and 32)<>32
If TEMP_S_BOOK>41 Then TEMP_S_BOOK=1
Until FLG_EXIT<>0
Z=FLG_EXIT
While Z=2
A$=Str$(TEMP_S_BOOK)-" " : If Len(A$)=1 Then A$="0"+A$
S_BOOK=TEMP_S_BOOK
SEL=SEL_TEMP-1
DRECTORY$="Ap:Shakes/Text/"
A$=Str$(S_BOOK)-" " : If Len(A$)=1 Then A$="0"+A$
DRECTORY$=DRECTORY$+A$+"/" : Close 1
Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9 : INDX=0
ACT$=SEL$(SEL)
Z=0
Wend
Z=FLG_EXIT
While Z<>2
TEMP_SEL=SEL
Close 1 : Proc BOOK_LIST
SEL=TEMP_SEL
DRECTORY$="Ap:Shakes/Text/"
A$=Str$(S_BOOK)-" " : If Len(A$)=1 Then A$="0"+A$
DRECTORY$=DRECTORY$+A$+"/" : Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9 : INDX=0
Z=2
Wend
Screen Copy 4,0,2,640,144-(43*PAL) To 0,0,23
Screen Open 4,640,BACK_SCREEN,4,Hires
Screen Display 4,128,56,640,144-(43*PAL)
Screen Hide 4
Screen 4 : Flash Off : Cls 0 : Cls 1,16,0 To 624,BACK_SCREEN : Colour 1,$986 : Colour 2,$FFF : Colour 3,$0
Screen To Back 1
FO=TEMP_FO
Screen 4 : Set Font FO
F_STR$=Font$(FO) : FSIZE=Val(Mid$(F_STR$,30,4))
DEMO_FLG=1 : Proc VERSE : DEMO_FLG=0
Proc DISPLAY_A_PIC
OLD_ACT$=ACT$
FACE_OFFSET=0
Proc ACT_PRINT
Screen To Front 2
Screen To Front 4
Screen Copy 4,0,FACE_OFFSET+2,640,FACE_OFFSET+144-(43*PAL) To 0,0,23
Repeat
Screen Display 0,,SY1,,
Screen Display 2,,SY2,,
Wait Vbl
Add SY1,-2 : If SY1<35 Then Add SY1,2
Add SY2,2 : If SY2>ICONS_Y+2 Then Add SY2,-2
Until SY2=ICONS_Y+2 and SY1=35
Screen Show 4
End Proc
Procedure CHAPTER_VERSE
Screen 0
Cls 13,16,21 To 624,166-(43*PAL)
Screen Hide 2 : Screen Hide 4 : Screen Hide 1
FLG_EXIT=0
BOOK=S_BOOK
CHAPTER=0 : VERSE=0
If Instr(ACT$,"_")<>0
CHAPTER=Val(Mid$(ACT$,1,Instr(ACT$,"_")-1))
VERSE=Val(Mid$(ACT$,Instr(ACT$,"_")+1,Len(ACT$)))
End If
A$=Str$(BOOK)-" " : If Len(A$)=1 Then A$="0"+A$
FIL$="Ap:Shakes/Text/"+A$+"/00_00.Inf"
Open In 7,FIL$ : XXX=Free : Line Input #7,BOOK$ : Close 7
SET_FONT[22] : Set Font Param : Set Text 2
Ink 0 : Text 100+1,40+1,"Book"
Text 390+50+1,40+1,"Act"
Text 460+50+1,40+1,"Scene"
Set Text 0 : Ink 14 : Text 100,40,"Book"
Text 390+50,40,"Act"
Text 460+50,40,"Scene"
BOOK$=BOOK$-Chr$(13)
BOOK_SHOW[BOOK$,Str$(CHAPTER),Str$(VERSE)]
CHAP_X=0 : OLD_CHAP_X=0
Ink 0 : X=24
Box X+1,50+1 To X+380+1,100+1
Box X+2,50+1 To X+380+2,100+1
Ink 14 : Box X,50 To X+380,100
Repeat
Wait 5 : MOUSE_CONVERT
If(M_KEY and 32)=32 Then FLG_EXIT=1
FLG_MOVE=0
If(M_KEY and 4)=4 and CHAP_X>0 Then Add CHAP_X,-1 : FLG_MOVE=1
If(M_KEY and 8)=8 and CHAP_X<2 Then Add CHAP_X,1 : FLG_MOVE=1
If(M_KEY and 16)=16 Then FLG_EXIT=2
While FLG_MOVE=1
If OLD_CHAP_X>0
Ink 13
X=50+395+((OLD_CHAP_X-1)*70)
Box X+1,50+1 To X+50+1,100+1
Box X+2,50+1 To X+50+2,100+1
Box X,50 To X+50,100
End If
If OLD_CHAP_X=0
Ink 13
X=24
Box X+1,50+1 To X+380+1,100+1
Box X+2,50+1 To X+380+2,100+2
Box X,50 To X+380,100
End If
If CHAP_X>0
Ink 0
X=50+395+((CHAP_X-1)*70)
Box X+1,50+1 To X+50+1,100+1
Box X+2,50+1 To X+50+2,100+1
Ink 14 : Box X,50 To X+50,100
End If
If CHAP_X=0
Ink 0
X=24
Box X+1,50+1 To X+380+1,100+1
Box X+2,50+1 To X+380+2,100+1
Ink 14 : Box X,50 To X+380,100
End If
FLG_MOVE=0
Wend
If(M_KEY and 1)=1 and CHAP_X=0
Add BOOK,1
If BOOK>41
BOOK=0
End If
A$=Str$(BOOK)-" "
If Len(A$)=1
A$="0"+A$
End If
FIL$="Ap:Shakes/Text/"+A$+"/00_00.Inf"
Open In 7,FIL$ : XXX=Free : Line Input #7,BOOK$ : Close 7
BOOK$=BOOK$-Chr$(13)
BOOK_SHOW[BOOK$,Str$(CHAPTER),Str$(VERSE)]
End If
If(M_KEY and 2)=2 and CHAP_X=0
Add BOOK,-1
If BOOK<0
BOOK=41
End If
A$=Str$(BOOK)-" "
If Len(A$)=1
A$="0"+A$
End If
FIL$="Ap:Shakes/Text/"+A$+"/00_00.Inf"
Open In 7,FIL$ : XXX=Free : Line Input #7,BOOK$ : Close 7
BOOK$=BOOK$-Chr$(13)
BOOK_SHOW[BOOK$,Str$(CHAPTER),Str$(VERSE)]
End If
If(M_KEY and 1)=1 and CHAP_X=1
Add CHAPTER,1
If CHAPTER>5
CHAPTER=1
End If
BOOK_SHOW[BOOK$,Str$(CHAPTER),Str$(VERSE)]
End If
If(M_KEY and 2)=2 and CHAP_X=1
Add CHAPTER,-1
If CHAPTER<1
CHAPTER=5
End If
BOOK_SHOW[BOOK$,Str$(CHAPTER),Str$(VERSE)]
End If
If(M_KEY and 1)=1 and CHAP_X=2
Add VERSE,1
If VERSE>15
VERSE=1
End If
BOOK_SHOW[BOOK$,Str$(CHAPTER),Str$(VERSE)]
End If
If(M_KEY and 2)=2 and CHAP_X=2
Add VERSE,-1
If VERSE<1
VERSE=15
End If
BOOK_SHOW[BOOK$,Str$(CHAPTER),Str$(VERSE)]
End If
OLD_CHAP_X=CHAP_X
Until FLG_EXIT<>0
Proc BUTTON_WAIT
Cls 13,16,21 To 624,166-(43*PAL)
Screen Show 2 : Screen Show 4 : Screen Show 4
If FLG_EXIT=2
Close 1
S_BOOK=BOOK
Proc BOOK_LIST
Z=0 : Z1=1
CHAP=Val(Mid$(SEL$(Z+Z1),1,2))
If CHAP<>0
Repeat
Inc Z
CHAP=Val(Mid$(SEL$(Z),1,2))
Until CHAPTER=CHAP or CHAP=0
If CHAP=0
Add Z,-1
End If
Z1=0
Repeat
CHAP1=Val(Mid$(SEL$(Z+Z1),1,2))
VER=Val(Mid$(SEL$(Z+Z1),4,2))
Inc Z1
Until(VERSE=VER) or(VER=0) or(CHAP1<>CHAP)
If VER=0 or(CHAP1<>CHAP)
Add Z1,-2
Else
Add Z1,-1
End If
End If
SEL=Z+Z1
Screen 0
Open In 1,DRECTORY$+SEL$(SEL)
Open In 7,DRECTORY$+SEL$(SEL)+".Idx1" : INDX_MAX=(Lof(7)/4)-1 : Close 7
Bload DRECTORY$+SEL$(SEL)+".Idx1",9
ACT$=SEL$(SEL) : INDX=0
Screen 4 : Set Font FO : Set Text 0
FACE_OFFSET=0
Proc VERSE
Proc DISPLAY_A_PIC
ACT$=SEL$(SEL)
Proc ACT_PRINT
End If
Screen Show 1
End Proc
Procedure BOOK_SHOW[BOOK$,CHAP$,VERSE$]
Ink 0
If CHAP_X=0
Cls 13,21+4+2,51+1 To 21+4+298+80,99
End If
If CHAP_X>0
X=50+396+((CHAP_X-1)*70)
Cls 13,X+2,51+1 To X+48,99
End If
Set Text 2 : Text 30+1,80+1,Mid$(BOOK$,1,29)
Text 450+1,80+1,CHAP$
Text 520+1,80+1,VERSE$
Set Text 0 : Ink 14 : Text 30,80,Mid$(BOOK$,1,29)
Text 450,80,CHAP$
Text 520,80,VERSE$
End Proc